﻿using System;
using System.ServiceProcess;
using DBSchemaService.Core;

namespace DBSchemaService
{
    static class Program
    {

        //private static MainProcessor _schemaChangeProcessor;
        private static WorkItemProcessor _schemaChangeProcessor;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main()
        {
            if (Environment.UserInteractive)
            {
                _schemaChangeProcessor = new WorkItemProcessor();
                _schemaChangeProcessor.StartProcessor();   
            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] 
			    { 
				    new DBSchemaManagerSvc() 
			    };
                ServiceBase.Run(ServicesToRun);
            }
        }
    }
}
